<template>
  <div class="main-box">
    <div class="main-header ms-f-center">
      <div>ms-ui</div>
    </div>

    <div class="main-content ms-f-center">
      <div class="left-side">
        <div class="nav-items">
          <router-link
            v-for="(navItem, index) in naveItems"
            :to="navItem.path"
            :key="index"
          >
            {{ navItem.name }}
          </router-link>
        </div>
      </div>
      <div class="right-side">
        <router-view />
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { Vue, Component } from "vue-property-decorator";

@Component({
  name: "Layout",
})
export default class Layout extends Vue {
  naveItems = [
    { name: "Button", path: "/button" },
    { name: "Video", path: "/video" },
    { name: "Input", path: "/input" },
    { name: "Row", path: "/row" },
    { name: "Col", path: "/col" },
  ];
}
</script>

<style lang="less">
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  outline: 1px dashed red;
}
html,
body,
#app {
  height: 100%;
  width: 100%;
  overflow: hidden;
}
.ms-f-center {
  display: flex;
  justify-content: center;
  align-content: center;
}
.main-header {
  height: 50px;
  line-height: 50px;
  width: 100%;
  position: relative;
  background: #42b983;
  color: white;
  font-size: 16px;
  font-weight: 600;
}

.main-content {
  flex-direction: row;
  flex: 1;
  width: 100%;
  .left-side {
    width: 260px;
    background: white;
    .nav-items {
      a {
        text-align: center;
        color: cadetblue;
        line-height: 35px;
        display: block;
        text-decoration: none;
        &:hover {
          cursor: pointer;
          background: lemonchiffon;
        }
        &.router-link-active {
          background: lemonchiffon;
        }
      }
    }
  }
  .right-side {
    flex: auto;
    background: #ededed;
    height: calc(100vh - 50px);
    overflow: scroll;
    padding: 20px;
  }
}
</style>
